<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.js"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.js"></script>
	</head>

	<body>
		<div class="list-box"></div>
	</body>
	<script>
		const { groupBy, orderBy } = _
		var users = [
			{
				user: 'zw',
				age: 48,
			},
			{
				user: 'zw',
				age: 36,
			},
			{
				user: 'fred',
				age: 40,
			},
			{
				user: 'barney',
				age: 34,
			},
		]
		const now = groupBy(users, item => item.user)
		// console.log(Object.values(groupBy([], item => item.s.sku_name)).reduce((pre, item) => pre.concat(item), []))
		const arr = [20, 10, 99, 55]
		// console.log(orderBy(arr), 9999999)
	</script>
	<script>
		$(() => {
			const users = [
				{
					user: 'zw',
					age: 48,
				},
				{
					user: 'zw',
					age: 36,
				},
				{
					user: 'fred',
					age: 40,
				},
				{
					user: 'barney',
					age: 34,
				},
			]
			const box = $('.list-box')
			box.click(e => {
				if (e.target.tagName === 'BUTTON' && [...e.target.classList].includes('edit')) {
					console.log('编辑')
				}
			})
			const content = users.reduce((pre, item, index) => {
				pre += `<div>第${index}个盒子,名称:${item.user} <button class='edit'>编辑</button>  </div>`
				return pre
			}, '')
			box.html(content)
		})
	</script>
</html>
